#
# dtd2rep_templates.py
#
#
# dtd2rep: A simple XML DTD to repository generator. 
#
# Copyright (C) 2004, 2005 Raphael Marvie 
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# http://www.fsf.org/licensing/licenses/gpl.html
#
# Author contact: raphael.marvie@lifl.fr
#

'''
Templates for the simple XML DTD to repository generator. These
templates are the repository implementation.
'''

__version__ = '0.2.0'
__date__    = 'Thu Dec 16 22:30:53 CET 2004'
__author__  = 'Raphael Marvie <raphael.marvie@lifl.fr>'


class tmpl:
    header_str = """#
# %s
#
#
# Generated file, do not edit
#

__version__ = '%s'
__date__    = '%s'
__author__  = 'Generated by dtd2rep (c) 2004-2005, raphael.marvie@lifl.fr'
"""

    footer_str = """
#
# end of generated file
#
"""

    class_str = """
class %s:
    def __init__ (self):
"""

    attr_str = """        self.%s = None
"""

    elem_simple_str = """        self._%s = None
"""

    elem_multiple_str = """        self._%s = list ()
"""

    elem_multiple_method_tmpl = """
    def get_%(name)s (self):
        return self._%(name)s
    
    def add_%(name)s (self, elt):
        self._%(name)s .append (elt)
"""

    elem_simple_method_tmpl = """
    def get_%(name)s (self):
        return self._%(name)s
    
    def set_%(name)s (self, elt):
        self._%(name)s = elt
"""

